import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';

@Component({
  selector: 'app-task-header',
  templateUrl: './task-header.component.html',
  styleUrls: ['./task-header.component.scss'],
  changeDetection:ChangeDetectionStrategy.OnPush
})
export class TaskHeaderComponent implements OnInit {
  @Input() header = '';
  @Output() newTask = new EventEmitter<void>();
  @Output() moveAll = new EventEmitter<void>();
  @Output() delList = new EventEmitter<void>();
  @Output() editList = new EventEmitter<void>();

  constructor() { }

  ngOnInit() {
  }
  // 点击新任务
  onNewTaskClick(){
    this.newTask.emit();
  }
  // 修改本列表所有内容
  onMoveAllClick(){
    this.moveAll.emit();
  }
  // 点击删除
  onDelListClick(){
    this.delList.emit();
  }
  // 修改列表名称
  onEditListClick(){
    this.editList.emit();
  }
}
